import { Dispatch } from "./dispatch"

export interface MiddlewareAPI<D extends Dispatch = Dispatch, State = any> {
  dispatch: D
  getState: () => State
}

export type MiddleWare<State> = (
  dispatch: Dispatch,
  getState: () => State,
) => (next: Dispatch) => Dispatch